import {  lazy } from "react";
import { createBrowserRouter } from "react-router-dom";
import App from "../App";
const Home = lazy(() => import("../page/home/Index"));
const Order = lazy(() => import("../page/order/Index"));
const Login = lazy(() => import("../page/login/Index"));
const Detail = lazy(() => import("../page/detail/Index"));
const Set = lazy(() => import("../page/set/Index"));
const Menu = lazy(() => import("../page/set/menu/Index"));
import {  AppstoreAddOutlined, } from '@ant-design/icons';
// 三级路由
export const houserouters=[
    {
        path:'/home/order',
        element:<Order></Order>,
        title:'仪表盘',
        icon:<AppstoreAddOutlined />
    },
    {
        path:'/home/detail',
        element:<Detail></Detail>,
        title:'数据可视化',
        icon:<AppstoreAddOutlined />
    },
    {
        path:'/home/set',
        element:<Set></Set>,
        title:'列表页',
        icon:<AppstoreAddOutlined />,
        children:[
            {
                path:'/home/set/menu',
                element:<Menu></Menu>,
                title:'查询表格'
            }
        ]
    }
]
const routes = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    children: [
      {
        index: true,
        element: <Home></Home>,
      },
      {
        path:'/home',
        element:<Home></Home>,
        children:houserouters
      }
    ],
  },
  {
    path:'/login',
    element:<Login></Login>
  },
 
]);
export default routes;
